''' request expected input parameters for this form
keywords = request("keywords")
end sub
sub request_title
''' request expected input parameters for this form
Cat = request("Cat")
Cat1 = request("Cat1")
Cat2 = request("Cat2")
Cat3 = request("Cat3")
CatID = request("CatID")
CatId1 = request("CatId1")
CatId2 = request("CatId2")
CatId3 = request("CatId3")
ParentId = request("ParentId")
CatsList = request("CatsList")
end sub
sub request_view_rootcats
''' request expected input parameters for this form
CatType = request("CatType")
SubCatId = request("SubCatId")
SubCat = request("SubCat")
Cat = request("Cat")
CatID = request("CatID")
end sub
sub request_view_subcats
''' request expected input parameters for this form
SubCatId = request("SubCatId")
SubCat = request("SubCat")
Cat = request("Cat")
CatID = request("CatID")
end sub
sub request_view_links
''' request expected input parameters for this form
DownloadURL = request("DownloadURL")
Email = request("Email")
LinkID = request("LinkID")
URL = request("URL")
Title = request("Title")
Cat = request("Cat")
LinkType = request("LinkType")
Description = request("Description")
DateAdded = request("DateAdded")
Priority = request("Priority")
ClickThrus = request("ClickThrus")
Impressions = request("Impressions")
CatID = request("CatID")
DownloadFee = request("DownloadFee")
end sub
sub request_view_relatedcats
''' request expected input parameters for this form
Cat = request("Cat")
CatID = request("CatID")
RelatedCat = request("RelatedCat")
RelatedCatId = request("RelatedCatId")
end sub
sub validate_search
''' request and validate data entered from this form
keywords = trim(request("keywords"))
end sub
sub validate_title
''' request and validate data entered from this form
Cat = trim(request("Cat"))
Cat1 = trim(request("Cat1"))
Cat2 = trim(request("Cat2"))
Cat3 = trim(request("Cat3"))
CatID = trim(request("CatID"))
CatId1 = trim(request("CatId1"))
CatId2 = trim(request("CatId2"))
CatId3 = trim(request("CatId3"))
ParentId = trim(request("ParentId"))
CatsList = trim(request("CatsList"))
end sub
sub validate_view_rootcats
''' request and validate data entered from this form
CatType = trim(request("CatType"))
SubCatId = trim(request("SubCatId"))
SubCat = trim(request("SubCat"))
Cat = trim(request("Cat"))
CatID = trim(request("CatID"))
end sub
sub validate_view_subcats
''' request and validate data entered from this form
SubCatId = trim(request("SubCatId"))
SubCat = trim(request("SubCat"))
Cat = trim(request("Cat"))
CatID = trim(request("CatID"))
end sub
sub validate_view_links
''' request and validate data entered from this form
DownloadURL = trim(request("DownloadURL"))
Email = trim(request("Email"))
LinkID = trim(request("LinkID"))
URL = trim(request("URL"))
Title = trim(request("Title"))
Cat = trim(request("Cat"))
LinkType = trim(request("LinkType"))
Description = trim(request("Description"))
DateAdded = trim(request("DateAdded"))
if DateAdded <> "" AND (not isdate(DateAdded)) then
error_list.add "488560date","Added must be a valid date (MM/DD/YY)."
b_error = true
end if
Priority = trim(request("Priority"))
ClickThrus = trim(request("ClickThrus"))
Impressions = trim(request("Impressions"))
CatID = trim(request("CatID"))
DownloadFee = trim(request("DownloadFee"))
end sub
sub validate_view_relatedcats
''' request and validate data entered from this form
Cat = trim(request("Cat"))
CatID = trim(request("CatID"))
RelatedCat = trim(request("RelatedCat"))
RelatedCatId = trim(request("RelatedCatId"))
end sub
sub db_select_Title
Title_sql = "SELECT Cats.CatId, Cats.Cat As Cat, Cats1.Cat As Cat1, Cats1.CatId AS CatId1, Cats2.Cat AS Cat2, Cats2.CatId AS CatId2, Cats3.Cat AS Cat3, Cats3.CatId AS CatId3 FROM (((Cats As Cats3 left JOIN Cats As Cats2 ON Cats3.ParentId = Cats2.CatId) left JOIN Cats As Cats1 ON Cats2.ParentId = Cats1.CatId) LEFT JOIN Cats As Cats ON Cats1.ParentId = Cats.CatId) WHERE Cats3.CatId = " & to_sql(CatID,"number") & ""
end sub
sub db_delete_Title
sql = "DELETE FROM " & _
""
'response.write sql
on error resume next
cn.Execute(sql)
if err.number <> 0 then
b_error = true
end if
on error goto 0
end sub
sub db_select_view_RootCats
view_RootCats_sql = "SELECT " & _
"Cats.Cat AS Cat, " & _
"Cats.CatId AS CatId," & _
"SubCats.Cat AS SubCat," & _
"SubCats.CatId AS SubCatId " & _
"FROM ((Cats LEFT JOIN CatTypes ON CatTypes.CatTypeId = Cats.CatTypeId) " & _
"LEFT JOIN Cats AS SubCats ON SubCats.ParentId = Cats.CatId) " & _
"WHERE CatType = 'Resources' AND Cats.ParentId IS NULL ORDER BY Cats.Cat"
end sub
sub db_delete_view_RootCats
sql = "DELETE FROM " & _
""
'response.write sql
on error resume next
cn.Execute(sql)
if err.number <> 0 then
b_error = true
end if
on error goto 0
end sub
sub db_select_view_SubCats
view_SubCats_sql = "SELECT " & _
"Cats.Cat AS Cat, " & _
"Cats.CatId AS CatId," & _
"SubCats.Cat AS SubCat," & _
"SubCats.CatId AS SubCatId " & _
"FROM Cats LEFT JOIN Cats AS SubCats ON SubCats.ParentId = Cats.CatId " & _
"URL FROM Cats, Links, LinkTypes WHERE Cats.CatID=Links.CatID AND Links.LinkTypeID=LinkTypes.LinkTypeID AND (Links.Title LIKE '%" & keywords & "%' OR Links.Description LIKE '%" & keywords & "%')"
else
view_Links_sql = "SELECT " & _
"AvgRating, " & _
"Links.CatId," & _
"Cat, " & _
"ClickThrus, " & _
"DownloadFee, " & _
"Links.Description AS Description, " & _
"DownloadURL, " & _
"Email, " & _
"DateAdded, " & _
"Impressions, " & _
"LinkID, " & _
"LinkType, " & _
"Priority, " & _
"Ratings, " & _
"Title, " & _
"URL FROM Cats, Links, LinkTypes WHERE Cats.CatID=Links.CatID AND Links.LinkTypeID=LinkTypes.LinkTypeID AND Display=TRUE AND Links.CatID = " & to_sql(CatID,"number") & ""
end if
if request("sortby") <> "" AND inStr(lcase(view_Links_sql),"order by") = 0 then view_Links_sql = view_Links_sql + " ORDER BY " & request("sortby")
end sub
sub db_delete_view_Links
sql = "DELETE FROM Links" & _
" WHERE " & _
"CatID = " & to_sql(CatID,"number") & ""
'response.write sql
on error resume next
cn.Execute(sql)
if err.number <> 0 then
b_error = true
end if
on error goto 0
end sub
sub db_select_view_RelatedCats
view_RelatedCats_sql = "SELECT Cat AS RelatedCat, CatID AS RelatedCatId FROM Cats WHERE RelatedId = " & to_sql(CatID,"number") & ""
end sub
sub db_delete_view_RelatedCats
sql = "DELETE FROM " & _
""
'response.write sql
on error resume next
cn.Execute(sql)
if err.number <> 0 then
b_error = true
end if
on error goto 0
end sub
do_search = request("do_search")
''' request form keys
keywords = request("keywords")
CatID = request("CatID")
''' request action
action = lcase(request("action"))
''' action case handler
select case action
end select
' no action was specified, so handle the default case(s)